﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/AdmMasterPage.master" AutoEventWireup="true" CodeFile="0501.aspx.cs" Inherits="admin_UC05_0501" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="aspnetpager" Namespace="Wuqi.Webdiyer" TagPrefix="Webdiyer" %>
<%@ Register Src="../UserControl/CKEditor.ascx" TagName="CKEditor" TagPrefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <asp:Panel ID="pnlContent" runat="server">
        <fieldset class="fieldset">
            <h1>
                線上諮詢內容編輯</h1>
            <table style="width: 100%" class="FormTable">
                
                <tr>
                    <td>
                        姓名
                    </td>
                    <td>
                        <asp:TextBox ID="txtCreateName" runat="server" Width="100px" Enabled="false"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Email
                    </td>
                    <td>
                        <asp:TextBox ID="txtEMail" runat="server" Width="280" Enabled="false"></asp:TextBox>
                    </td>
                </tr>    
                <tr>
                    <td>
                        手機
                    </td>
                    <td>
                        <asp:TextBox ID="txtMobile" runat="server" Width="100px" Enabled="false"></asp:TextBox>
                    </td>
                </tr>   
                <tr>
                    <td>
                        主旨
                    </td>
                    <td>
                        <asp:TextBox ID="txtTitle" runat="server" Width="600" Enabled="false"></asp:TextBox>
                    </td>
                </tr>  
                <tr>
                    <td>
                        問題
                    </td>
                    <td>
                        <asp:TextBox ID="txtContent" runat="server" Width="600" TextMode="MultiLine" Height="100px"></asp:TextBox>
                    </td>
                </tr>       
                <tr>
                    <td valign="top">
                        回覆
                    </td>
                    <td>
                        <uc1:CKEditor ID="ckeContent" runat="server" />
                    </td>
                </tr>  
                <tr>
                    <td>
                        user同意公開
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlUserAgreePublish" runat="server" Enabled="false">
                            <asp:ListItem Text="是" Value="True"></asp:ListItem>
                            <asp:ListItem Text="否" Value="False"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>   
                <tr>
                    <td>
                        前台顯示
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlAdminAgreePublish" runat="server">
                            <asp:ListItem Text="是" Value="True"></asp:ListItem>
                            <asp:ListItem Text="否" Value="False"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>   
                <tr>
                    <td colspan="2" height="30px" align="center">
                        <asp:Button ID="btnSave" runat="server" Text="儲存修改" OnClick="btnSave_Click" />
                        <asp:Button ID="btnCancel" runat="server" Text="取消" OnClick="btnCancel_Click" CausesValidation="false" />
                        <asp:Label ID="Label1" runat="server" Text="" ForeColor="Red" EnableViewState="false"></asp:Label>
                    </td>
                </tr>
            </table>
        </fieldset>
    </asp:Panel>
    <br />
            <asp:Panel ID="Panel1" runat="server" DefaultButton="btnQuery">
                <table style="width: 100%" class="FormTable" align="center">
                    <tr>
                        <td height="30px" colspan="2" class="labelHeader">
                            <div align="center" id="title">
                                線上諮詢紀錄查詢</div>
                            <hr border="1" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            時間：
                        </td>
                        <td height="30px" style="text-align: left">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txtDateFrom" runat="server" Width="65px" MaxLength="10" ValidationGroup="EditDateGroup" />
                                        <asp:Image ID="butDay1" runat="server" ImageUrl="~/admin/images/calendar.gif" AlternateText="開啟日曆，點選日期"
                                            CssClass="CalnedarImg" />
                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateFrom"
                                            PopupButtonID="butDay1" CssClass="MyCalendar" Format="yyyy/MM/dd" />
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtDateFrom"
                                            Display="Dynamic" ErrorMessage="日期格式輸入不正確" ValidationExpression="^((?:19|20)\d\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$"></asp:RegularExpressionValidator>
                                        <asp:Label ID="Label5" runat="server">~</asp:Label>
                                        <asp:TextBox ID="txtDateTo" runat="server" Width="65px" MaxLength="10" ValidationGroup="EditDateGroup" />
                                        <asp:Image ID="butDay2" runat="server" ImageUrl="~/admin/images/calendar.gif" AlternateText="開啟日曆，點選日期"
                                            CssClass="CalnedarImg" />
                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDateTo"
                                            PopupButtonID="butDay2" CssClass="MyCalendar" Format="yyyy/MM/dd" />
                                        <asp:RegularExpressionValidator ID="rev" runat="server" ControlToValidate="txtDateTo"
                                            Display="Dynamic" ErrorMessage="日期格式輸入不正確" ValidationExpression="^((?:19|20)\d\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$"></asp:RegularExpressionValidator>
                                        <asp:ValidationSummary runat="Server" ValidationGroup="EditDateGroup" ID="validationSummary"
                                            ShowSummary="true" />
                                    </td>
                                </tr>
                            </table>
                            <asp:Label ID="lblMsg" runat="server" Text="" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="30px" align="center">
                            <asp:ImageButton ID="btnQuery" runat="server" ImageUrl="~/admin/images/inner/button_search.gif"
                                OnClick="btnQuery_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <br />
            <div align="center">
                <asp:GridView ID="gvDetail" runat="server" AutoGenerateColumns="False" Width="100%"
                    CssClass="datagrid" OnRowDataBound="gvDetail_RowDataBound" OnRowCommand="gvDetail_RowCommand">
                    <SelectedRowStyle CssClass="SelectedRowStyle" />
                    <Columns>
                        <asp:BoundField DataField="CreatedDate" HeaderText="日期" ItemStyle-HorizontalAlign="Left">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                            <ItemStyle Width="20%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CreateName" HeaderText="姓名" ItemStyle-HorizontalAlign="Left">
                            <ItemStyle HorizontalAlign="Left" />
                            <ItemStyle Width="10%" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="回覆">
                            <ItemTemplate>
                                <asp:Label ID="lblReply" runat="server"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="前台顯示">
                            <ItemTemplate>
                                <asp:Label ID="lblShow" runat="server"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="EMail" HeaderText="電子信箱" ItemStyle-HorizontalAlign="Left">
                            <HeaderStyle Width="50px" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Mobile" HeaderText="手機" ItemStyle-HorizontalAlign="Left">
                            <HeaderStyle Width="50px" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Title" HeaderText="主旨" ItemStyle-HorizontalAlign="Left">
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>   
                        <asp:TemplateField HeaderText="回覆">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnModify" runat="server" CommandArgument='<%# Eval("MessageId") %>'
                                    Text="編輯" CommandName="myModify" CausesValidation="False" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <div align="center" class="labelMsg">
                            找不到符合資料!</div>
                    </EmptyDataTemplate>
                </asp:GridView>
                <Webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="PagerStyle" HorizontalAlign="center"
                    OnPageChanged="AspNetPager1_PageChanged" PageIndexBoxType="TextBox" PageSize="20"
                    ShowPageIndexBox="Never" />
            </div>
</asp:Content>

